package org.chen.spring.cloud.finchley.service;

import org.chen.spring.cloud.finchley.model.User;
import org.chen.spring.cloud.finchley.service.impl.UserFeignServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 远程接口
 *
 * @author chensj
 * @date 2020-02-07 20:54
 */
@FeignClient(name = "provider", fallback = UserFeignServiceImpl.class)
public interface UserFeignService {
    /**
     * 用户新增
     *
     * @param user 用户信息
     * @return 结果
     */
    @RequestMapping(value = "/user/add", method = RequestMethod.GET)
    public String addUser(User user);

    /**
     * 用户更新
     *
     * @param user 用户信息
     * @return 结果
     */
    @RequestMapping(value = "/user/update", method = RequestMethod.POST)
    public String updateUser(@RequestBody User user);
}
